﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DomainExample.Repository.Tests.PersonRepositoryTests
{
    [TestClass]
    public sealed class PersonRepositoryRemoveTests : PersonRepositoryTests
    {
        [TestInitialize]
        public void SetUp()
        {
            CreateSchema();
        }

        [TestCleanup]
        public void TearDown()
        {
            DestroySchema();
        }

        [TestMethod]
        [TestCategory("Database Integration")]
        public void PersonRepositoryRemoveExpectRemoved()
        {
            const string expectedFirstName = "Alice";
            const string expectedLastName = "Sample";
            var testPerson = AddTestPerson(expectedFirstName, expectedLastName);

            Target.Remove(testPerson.Id);

            var result = Target.GetById(testPerson.Id);
            Assert.IsNull(result);
        }
    }
}
